package web.dispatch;

import aplicacao.classesBasicas.Exercicio;
import aplicacao.repositorios.CadastroExercicios;


import com.opensymphony.xwork2.ActionSupport;

public class ExercicioCRUD extends ActionSupport{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Exercicio exercicio;
	
	public Exercicio getExercicio() {
		return exercicio;
	}

	public void setExercicio(Exercicio exercicio) {
		this.exercicio = exercicio;
	}

	public ExercicioCRUD() {
		// TODO Auto-generated constructor stub
		this.exercicio = new Exercicio();
	}
	
	public String cadastrar() throws Exception{
		CadastroExercicios.cadastrarExercicio(exercicio);
		return "listagem";
	}
	
	public String remover() throws Exception{
		CadastroExercicios.removerExercicio(exercicio);
		return "listagem";
	}

}
